草庐IT

linux - Lua 在 Linux 上找不到 LuaRocks 安装的模块

全部标签

ruby - 为什么在 rvm 安装中有两个 rake gemspecs?

为什么在rvm安装中有两个rakegemspecs?~-10:59>find~/.rvm/-name'rake-0.8.7.gemspec'~/.rvm/gems/ruby-1.9.2-p136/specifications/rake-0.8.7.gemspec~/.rvm/gems/ruby-1.9.2-p136@global/specifications/rake-0.8.7.gemspec#alias~/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/gems/1.9.1/specifications/rake-0.8.7.gemspec为什么不同?(非

使用时 Rubygems 2.0.14 不是线程安全的 bundle 程序安装消息 - RUBYGEMS VERSION : 2. 4.5.1

运行bundle安装时,我收到以下消息:Rubygems2.0.14isnotthreadsafe,soyourgemswillbeinstalledoneatatime.UpgradetoRubygems2.1.0orhighertoenableparallelgeminstallation.这很奇怪,因为在我的RubyGems环境中它说我的RubyGems版本是:2.4.5.1(见下文)~/w/Rafftopia❯❯❯gemenvRubyGemsEnvironment:-RUBYGEMSVERSION:2.4.5.1-RUBYVERSION:2.2.5(2016-04-26patc

ruby-on-rails - 使用 Rails 5 完成类(class)和模块分配给用户

编辑#2这是类(class)ControllerclassCoursesController编辑#1因此,根据下面Jagdeep的回答,我现在完成了以下操作:类(class).rbclassCoursecourse_modules_user.rbclassCourseModulesUsercourses_user.rbclassCoursesUser用户.rbclassUser迁移classCreateCoursesUsers但是,我遇到这样的错误原始问题所以这是previousquestion的延续,然而,这会偏离那个主题,所以这里是一个新的主题。在此之后,我大致得到了我想要开始工作

ruby - block 看不到方法( Chef 资源)

假设我们有两个资源:template'template1'doowner'root'group'root'endtemplate'template2'doowner'root'group'root'end我想在资源中重用代码。但是,如果我在配方中定义了一个过程,您会得到owner、group等的NoMethodError。为什么会这样?词法范围没有什么不同,是吗?因此,我必须使用self.instance_eval&common_cfg。common_cfg=Proc.new{owner'root'group'root'}template'template1'docommon_cfg.

ruby-on-rails - 本地 gem 的“bundle 安装”没有解决依赖关系,而 'gem install' 可以

我在目录“/home/enterprise/pkg”中有一个本地gem(enterprise-0.0.1.gem)。它依赖于active_directorygem(v1.5.5),这是在它的enterprise.gemspec文件中指定的,如下所示:-gem.add_dependency("active_directory")在我的应用程序的Gemfile中,我添加了以下行:-gem'enterprise','0.0.1',path=>'/home/enterprise/pkg'当我做的时候bundleinstall在我的应用程序的源目录中,只安装了企业gem。因此,我遇到了引用act

ruby-on-rails - 为 Ruby gem 创建安装生成器

我是构建Rubygems的新手,正在尝试我的第一个。我正在为我的gem编写一个生成器,它将在我的Rails应用程序中生成一个迁移。我希望将gem简单地包含在Rails应用程序中,运行“railsgmygem:install”以创建迁移,然后运行“rakedb:migrate”以完成所有操作。我已经找到了几种不同的方法来完成类似的任务,但到目前为止没有任何效果。我似乎无法让Rails应用程序找到生成器。我尝试过的最新指南位于此处:http://www.railsdispatch.com/posts/how-rails-3-enables-more-choices-part-1.这是我当前

ruby-on-rails - Spree 模块装饰器

我正在为我的在线商店使用SpreeCommerce。我想在结帐过程中更改一些行为,这些行为在spreegem内的app/models/spree/order/checkout.rb中定义。所以我在我的应用程序中的同一点创建了一个checkout_decorator.rb。问题是,我的更改没有加载。另一个问题是,模块内的所有内容都在一个方法内,即defself.included(klass)方法。所以我想我必须覆盖整个文件,而不是只覆盖一种方法。这是我的装饰器的样子:checkout_decorator.rbSpree::Order::Checkout.module_evaldodefs

ruby - 猴子修补 float 中缀运算符产生意想不到的结果

重新定义Float#/似乎没有效果:classFloatdef/(other)"magic!"endendputs10.0/2.0#=>5.0但是当另一个中缀运算符Float#*被重新定义时,Float#/突然采用了新的定义:classFloatdef/(other)"magic!"enddef*(other)"spooky"endendputs10.0/2.0#=>"magic!"我很想知道是否有人可以解释这种行为的来源,以及其他人是否得到相同的结果。ruby:ruby2.0.0p353(2013-11-22)[x64-mingw32]要快速确认错误,请运行thisscript.

ruby - 在我的 Mac 上安装 ruby​​ gem json 时遇到问题

我在尝试通过ruby​​gems安装json模块时收到此警告。有什么想法吗?Mac-Minipoulh$sudogeminstalljsonPassword:WARNING:File'/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/specifications/json-1.2.0.gemspec'doesnotevaluatetoagemspecificationBuildingnativeextensions.Thiscouldtakeawhile...ERROR:Errori

ruby - 无法安装任何 gem

我已经使用JavaScript和一些Erlang大约六个月了,最近我没有进行任何Rails编程。今天在我的新电脑上我去安装Rails但出现了这个错误:geminstallrailsWARNING:RubyGems1.2+indexnotfoundfor:http://gems.rubyforge.org/RubyGemswillreverttolegacyindexesdegradingperformance.BulkupdatingGemsourceindexfor:htp://gems.rubyforge.org/ERROR:Whileexecutinggem...(Gem::Re